analytics

James Peret 7 years ago
parent
commit
5bda5fb1ec
5 changed files with 31 additions and 13 deletions
  1. 16 8
      app/index.html
  2. 9 1
      app/scripts/controllers/main.js
  3. 3 3
      app/views/main.html
  4. 2 0
      app/views/servicos.html
  5. 1 1
      app/views/solucoes.html

+ 16 - 8
app/index.html

@@ -77,16 +77,20 @@
77 77
 
78 78
 
79 79
     <!-- Google Analytics: change UA-XXXXX-X to be your site's ID -->
80
-     <script>
81
-       !function(A,n,g,u,l,a,r){A.GoogleAnalyticsObject=l,A[l]=A[l]||function(){
82
-       (A[l].q=A[l].q||[]).push(arguments)},A[l].l=+new Date,a=n.createElement(g),
83
-       r=n.getElementsByTagName(g)[0],a.src=u,r.parentNode.insertBefore(a,r)
84
-       }(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
85
-
86
-       ga('create', 'UA-XXXXX-X');
80
+    <script>
81
+       (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
82
+       (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
83
+       m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
84
+       })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
85
+       ga('create', 'UA-81425302-1', 'auto');
87 86
        ga('send', 'pageview');
88 87
     </script>
89 88
 
89
+    <!-- start Mixpanel --><script type="text/javascript">(function(e,a){if(!a.__SV){var b=window;try{var c,l,i,j=b.location,g=j.hash;c=function(a,b){return(l=a.match(RegExp(b+"=([^&]*)")))?l[1]:null};g&&c(g,"state")&&(i=JSON.parse(decodeURIComponent(c(g,"state"))),"mpeditor"===i.action&&(b.sessionStorage.setItem("_mpcehash",g),history.replaceState(i.desiredHash||"",e.title,j.pathname+j.search)))}catch(m){}var k,h;window.mixpanel=a;a._i=[];a.init=function(b,c,f){function e(b,a){var c=a.split(".");2==c.length&&(b=b[c[0]],a=c[1]);b[a]=function(){b.push([a].concat(Array.prototype.slice.call(arguments,
90
+    0)))}}var d=a;"undefined"!==typeof f?d=a[f]=[]:f="mixpanel";d.people=d.people||[];d.toString=function(b){var a="mixpanel";"mixpanel"!==f&&(a+="."+f);b||(a+=" (stub)");return a};d.people.toString=function(){return d.toString(1)+".people (stub)"};k="disable time_event track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config reset people.set people.set_once people.increment people.append people.union people.track_charge people.clear_charges people.delete_user".split(" ");
91
+    for(h=0;h<k.length;h++)e(d,k[h]);a._i.push([b,c,f])};a.__SV=1.2;b=e.createElement("script");b.type="text/javascript";b.async=!0;b.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:"file:"===e.location.protocol&&"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\/\//)?"https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js":"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";c=e.getElementsByTagName("script")[0];c.parentNode.insertBefore(b,c)}})(document,window.mixpanel||[]);
92
+    mixpanel.init("5bf2a78c7fd703fcbb7dd092df27cbb2");</script><!-- end Mixpanel -->
93
+
90 94
     <!-- build:js(.) scripts/vendor.js -->
91 95
     <!-- bower:js -->
92 96
     <script src="bower_components/jquery/dist/jquery.js"></script>
@@ -112,6 +116,10 @@
112 116
         <script src="scripts/controllers/main.js"></script>
113 117
         <script src="scripts/controllers/footer.js"></script>
114 118
         <script src="scripts/controllers/about.js"></script>
115
-        <!-- endbuild -->
119
+    <!-- endbuild -->
120
+
121
+    <script type="text/javascript">
122
+      mixpanel.track("Website loaded");
123
+    </script>
116 124
 </body>
117 125
 </html>

+ 9 - 1
app/scripts/controllers/main.js

@@ -8,9 +8,13 @@
8 8
  * Controller of the siteOficinaItapetiApp
9 9
  */
10 10
 angular.module('siteOficinaItapetiApp')
11
-  .controller('MainCtrl', [ '$window', '$scope', '$rootScope', '$http', 'Lightbox', function ($window, $scope, $rootScope, $http, Lightbox) {
11
+  .controller('MainCtrl', [ '$window', '$scope', '$rootScope', '$http', 'Lightbox', '$state', function ($window, $scope, $rootScope, $http, Lightbox, $state) {
12 12
       $window.scrollTo(0, 0);
13 13
 
14
+      console.log("Current Page: " + $state.current.name);
15
+
16
+      mixpanel.track("Page Visit", {"Page": $state.current.name});
17
+
14 18
       $scope.Math = window.Math;
15 19
 
16 20
       $scope.laser_cut = {
@@ -182,5 +186,9 @@ angular.module('siteOficinaItapetiApp')
182 186
     Lightbox.openModal($scope.images, index);
183 187
   };
184 188
 
189
+  $scope.service_contact_form_open = function() {
190
+    mixpanel.track("Interested", {"Page": $state.current.name});
191
+  }
192
+
185 193
 
186 194
 }]);

+ 3 - 3
app/views/main.html

@@ -18,7 +18,7 @@
18 18
         <img src="images/thumb-solucoes.jpg" alt="...">
19 19
         <div class="caption">
20 20
           <h3><a ui-sref="solucoes">Soluções</a></h3>
21
-          <p>Desenvolvimento de soluções para resolver problemas especificos.</p>
21
+          <p>Soluções criativas e tecnologicas para o seu problema.</p>
22 22
         </div>
23 23
       </div>
24 24
     </div>
@@ -26,8 +26,8 @@
26 26
       <div class="thumbnail">
27 27
         <img src="images/thumb-solidworks.jpg" alt="...">
28 28
         <div class="caption">
29
-          <h3><a ui-sref="desenho-tecnico">Desenho Técnico</a></h3>
30
-          <p>Criação de desenhos tecnicos para produção utilizando o Solidworks.</p>
29
+          <h3><a ui-sref="projetos">Projetos</a></h3>
30
+          <p>Desenvolvimento de projetos utilizando tecnologia CAD 3D.</p>
31 31
         </div>
32 32
       </div>
33 33
     </div>

+ 2 - 0
app/views/servicos.html

@@ -47,6 +47,7 @@
47 47
         </div>
48 48
       </div>
49 49
     </div>
50
+    <!--
50 51
     <div class="col-md-4 col-sm-6">
51 52
       <div class="thumbnail" style="min-height: 375px;">
52 53
         <img src="images/thumb-plasma.jpg" alt="...">
@@ -55,6 +56,7 @@
55 56
           <p>Protótipo funcional ou mock-up realizado com o uso de diversas técnicas.</p>
56 57
         </div>
57 58
       </div>
59
+    -->
58 60
   </div>
59 61
 
60 62
 </div>

+ 1 - 1
app/views/solucoes.html

@@ -11,7 +11,7 @@
11 11
   <div class="row">
12 12
     <div class="col-md-12">
13 13
       <p style="text-align: center; margin-top: 15px;">
14
-        <a class="btn btn-success" ui-sref="contato">Entrar em contato</a>
14
+        <a class="btn btn-success" ui-sref="contato" ng-click="service_contact_form_open()">Entrar em contato</a>
15 15
       </p>
16 16
     </div>
17 17
   </div>